package com.aaa.controller;


import com.aaa.entity.TenementPeople;
import com.aaa.query.TenementPeopleQuery;
import com.aaa.result.Result;
import com.aaa.service.TenementPeopleServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * create by: 刘涛
 * description: 租户管理-个人表
 * create time: 2021/1/24 18:58
 *
  * @Param: null
 * @return
 */

@RestController
@RequestMapping("/people")
public class TenementPeopleController {

    @Autowired
    private TenementPeopleServiceImpl service;

    /**
     * create by: 刘涛
     * description: 租户管理-个人表查询业务   模糊查询+分页+查询
     * create time: 2021/2/24 14:45
     *
      * @Param: null
     * @return
     */
    @GetMapping("/list")
    public Result listAll(@RequestBody TenementPeopleQuery query) {
        return service.listAll(query);

    }

    /**
     * create by: 刘涛
     * description: 租户管理-个人表添加业务
     * create time: 2021/2/24 14:45
     *
      * @Param: null
     * @return
     */
    @PostMapping("/add")
    public Result add(@RequestBody TenementPeople tenementPeople){
        return service.add(tenementPeople);
    }

    /**
     * create by: 刘涛
     * description: 租户管理-个人表删除业务
     * create time: 2021/2/24 14:45
     *
      * @Param: null
     * @return
     */

    @DeleteMapping ("/delete")
    public Result delete(@RequestBody TenementPeople tenementPeople){
        return service.del(tenementPeople);
    }

    /**
     * create by: 刘涛
     * description: 租户管理-个人表修改业务
     * create time: 2021/2/24 15:21
     *
      * @Param: null
     * @return
     */
    @PostMapping("/update")
    public Result update(@RequestBody TenementPeople tenementPeople){
        return service.updatePeople(tenementPeople);
    }
}

